<template>
  <quill-editor :id="quillKey"
                :key="quillKey"
                v-model="value" :ref="quillKey" :options="quillOption" @change="onEditorChange($event)">
  </quill-editor>
</template>

<script>
  import { quillEditor } from 'vue-quill-editor'
  import quillConfig from './quill-config.js'

  export default {
    props: {
      value: {
        type: String
      }, isDisabled: {
        default: false
      }, quillKey: { default: '' }
    },
    components: {
      quillEditor
    },
    data() {
      return {
        quillOption: quillConfig
      }
    },
    methods: {
      onEditorChange(event) {
        this.$emit('input', event.html)
      }
    }
  }
</script>

<style>

</style>
